package com.fanh.dto;


import com.fanh.common.util.DateUtil;
import com.fanh.model.GuideCourse;
import com.fanh.model.GuideCourseCategory;
import com.fanh.model.GuideLesson;
import com.fanh.model.SysUser;
import lombok.Data;

import java.util.Date;
import java.util.List;


public class GuideCourseResult extends GuideCourse {
 // 统计数字
 private int readCount;
  private int lessonCount;
 private long lastUpdateTime;
 private String lastUpdateTimeText;
 private GuideLesson newestLesson; // 最新课程
 private SysUser tearch;
 private List<GuideCourseCategory> categoryList;
 private int payCount;


 public void setLastUpdateTime(long lastUpdateTime) {
  long timeDiff = System.currentTimeMillis() -  newestLesson.getUpdateDate().getTime();
  this.lastUpdateTime = timeDiff;
 }

 public int getReadCount() {
  return readCount;
 }

 public void setReadCount(int readCount) {
  this.readCount = readCount;
 }

 public int getLessonCount() {
  return lessonCount;
 }

 public void setLessonCount(int lessonCount) {
  this.lessonCount = lessonCount;
 }

 public long getLastUpdateTime() {
  return lastUpdateTime;
 }

 public String getLastUpdateTimeText() {
  return lastUpdateTimeText;
 }

 public GuideLesson getNewestLesson() {
  return newestLesson;
 }

 public void setNewestLesson(GuideLesson newestLesson) {
  this.newestLesson = newestLesson;
 }

 public SysUser getTearch() {
  return tearch;
 }

 public void setTearch(SysUser tearch) {
  this.tearch = tearch;
 }

 public List<GuideCourseCategory> getCategoryList() {
  return categoryList;
 }

 public void setCategoryList(List<GuideCourseCategory> categoryList) {
  this.categoryList = categoryList;
 }

 public int getPayCount() {
  return payCount;
 }

 public void setPayCount(int payCount) {
  this.payCount = payCount;
 }

 public void setLastUpdateTimeText(String lastUpdateTimeText) {
  this.lastUpdateTimeText = DateUtil.getTimeDiffText(newestLesson.getUpdateDate());
   }


}